Generic Programming with Multiple Parameters

نویسنده

  • José Pedro Magalhães
چکیده

Generic programming, a form of abstraction in programming languages that serves to reduce code duplication by exploiting the regular structure of algebraic datatypes, has been present in the Haskell language in different forms for many years. Lately, a library for generic deriving has been given native support in the compiler, allowing programmers to write functions such as fmap that abstract over one datatype parameter generically. The power of this approach is limited to dealing with one parameter per datatype, however. In this paper, we lift this restriction by providing a generalisation of generic deriving that supports multiple parameters, making essential use of datatype promotion and kind polymorphism. We show example encodings of datatypes, and how to define a map function that operates on multiple parameters simultaneously.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Mathematical Programming Models for Solving Unequal-Sized Facilities Layout Problems - a Generic Search Method

 This paper present unequal-sized facilities layout solutions generated by a genetic search program named LADEGA (Layout Design using a Genetic Algorithm). The generalized quadratic assignment problem requiring pre-determined distance and material flow matrices as the input data and the continuous plane model employing a dynamic distance measure and a material flow matrix are discussed. Computa...

متن کامل

An extended comparative study of language support for generic programming

Many modern programming languages support basic generics, sufficient to implement type-safe polymorphic containers. Some languages have moved beyond this basic support, and in doing so have enabled a broader, more powerful form of generic programming. This paper reports on a comprehensive comparison of facilities for generic programming in eight programming languages: C++, Standard ML, Objectiv...

متن کامل

A New Compromise Decision-making Model based on TOPSIS and VIKOR for Solving Multi-objective Large-scale Programming Problems with a Block Angular Structure under Uncertainty

This paper proposes a compromise model, based on a new method, to solve the multi-objective large-scale linear programming (MOLSLP) problems with block angular structure involving fuzzy parameters. The problem involves fuzzy parameters in the objective functions and constraints. In this compromise programming method, two concepts are considered simultaneously. First of them is that the optimal ...

متن کامل

Multi-objective Optimization of Stirling Heat Engine Using Gray Wolf Optimization Algorithm (TECHNICAL NOTE)

The use of meta-heuristic optimization methods have become quite generic in the past two decades. This paper provides a theoretical investigation to find optimum design parameters of the Stirling heat engines using a recently presented nature-inspired method namely the gray wolf optimization (GWO). This algorithm is utilized for the maximization of the output power/thermal efficiency as well as...

متن کامل

Multi-Objective Location-Routing Model With Multiple Transportation Modes For Designing Relief Networks Under Uncertainty‎

A three-level relief chain including a number of suppliers in fixed locations, candidate distribution centers and affected areas at certain points are considered. A mixed integer nonlinear programming model is proposed for open transportation location routing problem by considering split delivery of demand. To solve a realistic problem, foregoing parameters are considered as fuzzy in our propos...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2014